package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 请求参数限定 params属性
 * @author stone
 * @date 2022/12/23 09:53
 */
@RequestMapping("params") // @RequestMapping注解的value属性才是窄化请求
@Controller//("params")// Controller注解是组件注册功能的注解，value属性指定的是组件的id
public class ParameterLimitController {

    //localhost:8080/params/login?username=songge&password=niupi
    //params = {"username","password"} 含义：既要携带username这个请求参数，也要携带password
    @RequestMapping(value = "login",params = {"username","password"})
    @ResponseBody
    public String login() {
        return "ok";
    }
}
